package com.asset.pojo;

import java.util.Date;

public class AssetUseHistory  {
    private Long id;
    private Long assetId;//资产id
	private String usePerson;//使用人
	private String userCode;//使用人编号
	private Date assignTime;//分配时间
	private Date receiveTime;//领用时间
	private Date revertTime;//归还时间
	private Short equipState;//设备使用状况
	private int assetSign;//最新操作标记 0代表最新标记  1代表以前标记
	
	
	public enum EquipState{
		    Fine("良好",(short)1),Service("损坏,需维修",(short)2),Scrap("损坏,已报废",(short)3);
			public short value;
			public String name;
			EquipState(String name,short value){
				this.value = value;
				this.name = name;
			}
		    
		    public static String getName(short value) {
	            for (EquipState c : EquipState.values()) {  
	                if (c.getValue() == value) {  
	                    return c.name;  
	                }  
	            }  
	            return null;  
	        } 
			public static short getValue(String name) {
	            for (EquipState c : EquipState.values()) {  
	                if (c.getName().equals(name)) {
	                    return c.value;  
	                }  
	            }
	            return 404;  
	        } 
			public short getValue(){
	            return value;
	        }
	        public void setValue(short value){
	            this.value = value;
	        }
	        public String getName(){
	            return name;
	        }
	        public void setName(String name){
	            this.name = name;
	        }
	}
	 

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Long getAssetId() {
		return assetId;
	}
	public void setAssetId(Long assetId) {
		this.assetId = assetId;
	}
	public String getUsePerson() {
		return usePerson;
	}
	public void setUsePerson(String usePerson) {
		this.usePerson = usePerson;
	}
	public String getUserCode() {
		return userCode;
	}
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	public Date getAssignTime() {
		return assignTime;
	}
	public void setAssignTime(Date assignTime) {
		this.assignTime = assignTime;
	}
	public Date getReceiveTime() {
		return receiveTime;
	}
	public void setReceiveTime(Date receiveTime) {
		this.receiveTime = receiveTime;
	}
	public Date getRevertTime() {
		return revertTime;
	}
	public void setRevertTime(Date revertTime) {
		this.revertTime = revertTime;
	}
	public Short getEquipState() {
		return equipState;
	}
	public void setEquipState(Short equipState) {
		this.equipState = equipState;
	}
	public int getAssetSign() {
		return assetSign;
	}
	public void setAssetSign(int assetSign) {
		this.assetSign = assetSign;
	}
	@Override
	public String toString() {
		return "AssetUseHistory [id=" + id + ", assetId=" + assetId + ", usePerson=" + usePerson + ", userCode="
				+ userCode + ", assignTime=" + assignTime + ", receiveTime=" + receiveTime + ", revertTime="
				+ revertTime + ", equipState=" + equipState + ", assetSign=" + assetSign + "]";
	}
}
